{% extends "layout.html" %}
{% block body %}
    {% if session.logged_in %}
    <form action="{{ url_for('add_entry') }}" method="post" class="add-entry">
        <dl>
            <dt>Title:</dt>
            <dd><input type="text" size="30" name="title"></dd>
            <dt>Text:</dt>
            <dd>
                <textarea id="text" name="text" cols="40" rows="5"></textarea>
                </dd>
                <dd>
                    <input type="submit" value="Share">
                </dd>
        </dl>
    <form>
    {% endif %}
    <ul class="entries">
        {% for entry in entries %}
        <li>
        <h2>{{ entry.title }}</h2>{{entry.text|safe}}
        </li>
        {% endfor %}
    </ul>
{% endblock %}
